Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

refactor(nuxt)!: remove support for 404.vue shorthand #8809

Merged
merged 1 commit into from
Nov 9, 2022

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Nov 8, 2022

πŸ”— Linked issue

resolves nuxt/nuxt#14702

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

This PR removes support for the 404.vue shorthand (mapping to a catchall with 404 status code). This was confusing when users also had a manual catchall, such as [...slug].vue (as the latter would never be hit). And it also separated out the 404 error page from error.vue which was used to render every other error page.

πŸ‘‰ Migration

  1. Rename your 404.vue page to [...slug].vue.
  2. Manually set the response status within that page.
  <script setup>
+   setResponseStatus(404)
  </script>

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added the bug Something isn't working label Nov 8, 2022
@danielroe danielroe requested review from pi0 and antfu November 8, 2022 13:21
@danielroe danielroe self-assigned this Nov 8, 2022
@codesandbox
Copy link

codesandbox bot commented Nov 8, 2022

CodeSandbox logoCodeSandbox logoΒ  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link

netlify bot commented Nov 8, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 17ac03c
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/636a57d32fc9fa0009ccafec

@danielroe danielroe added 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing breaking-change labels Nov 8, 2022
@pi0 pi0 changed the title fix(nuxt)!: remove support for 404.vue shorthand refactor(nuxt)!: remove support for 404.vue shorthand Nov 9, 2022
@pi0 pi0 merged commit 10c2272 into main Nov 9, 2022
@pi0 pi0 deleted the fix/remove-404-feature branch November 9, 2022 09:05
BenjaminOddou added a commit to BenjaminOddou/portfolio that referenced this pull request Nov 9, 2022
@pi0 pi0 mentioned this pull request Nov 15, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
@ibrahim-990
Copy link

hello,
why in production mode not work the 404 page
iam set [...slug].vue in folder pages

Copy link
Member Author

@ibrahim-990 If you are experiencing an issue, please open a new issue with a minimal reproduction πŸ™

@ibrahim-990
Copy link

i open

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x breaking-change bug Something isn't working 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

double catch-all doesn't work (both [...slug].vue and a 404.vue)
4 participants